<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>安全文明措施费</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="widtd=device-widtd, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="../css/main.css" media="all"/>
    <link rel="stylesheet" href="../css/securityFee.css" media="all"/>
</head>
<style>
    #addopen .layui-tab {
        margin: 0 !important;
    }
</style>
<body class="childrenBody all">
<div id="all">
    <div class="top" id="securityFee">
        <div>
            <button type="button" class="layui-btn" @click="adduser(1)"><i class="layui-icon">&#xe608;</i> 添加</button>
            <button type="button" @click="exports" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe621;</i>导出
            </button>
        </div>
        <div class="top_right">
            <!--<div class="layui-input-inline">-->
            <!--<input type="tel" name="phone" lay-verify="required|phone" placeholder="搜索项目序号、员工编号、费用类型、名称、使用人员"-->
            <!--autocomplete="off" class="layui-input">-->
            <!--</div>-->
            <!--<div>-->
            <!--<button type="button" class="layui-btn layui-btn-normal">搜索</button>-->
            <!--</div>-->
        </div>
    </div>
    <div class="tabs">
        <table class="layui-table" id="securityFees">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>材料编号</td>
                <td>材料名称</td>
                <td>规格型号</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率(%)</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr1" :key="index">
                <td>
                    <span class="operation" @click="adduser(2, item.id, 0)">编辑</span>
                    <span @click="del(item.id)" class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.cl_num}}</td>
                <td>{{item.associate.cl_name}}</td>
                <td>{{item.associate.cl_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>材料合计</b></td>
                <td>{{j1}}</td>
                <td>{{s1}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
        <table class="layui-table">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>人员编号</td>
                <td>工种</td>
                <td>规格型号<br/>(姓名)</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率(%)</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr2" :key="index+1">
                <td>
                    <span class="operation" @click="adduser(2, item.id, 1)">编辑</span>
                    <span @click="del(item.id)" class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.ry_num}}</td>
                <td>{{item.associate.ry_type}}</td>
                <td>{{item.associate.ry_name}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>工人工资合计</b></td>
                <td>{{j2}}</td>
                <td>{{s2}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
        <table class="layui-table">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>机械编号</td>
                <td>机械名称</td>
                <td>规格型号</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率(%)</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr3" :key="index+3">
                <td>
                    <span class="operation" @click="adduser(2, item.id, 2)">编辑</span>
                    <span @click="del(item.id)" class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.jx_num}}</td>
                <td>{{item.associate.jx_name}}</td>
                <td>{{item.associate.jx_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>机械费合计</b></td>
                <td>{{j3}}</td>
                <td>{{s3}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
        <table class="layui-table">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>材料编号</td>
                <td>材料名称</td>
                <td>规格型号</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率(%)</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr4" :key="index+4">
                <td>
                    <span class="operation" @click="adduser(2, item.id, 3)">编辑</span>
                    <span @click="del(item.id)" class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.cl_num}}</td>
                <td>{{item.associate.cl_name}}</td>
                <td>{{item.associate.cl_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>临建合计</b></td>
                <td>{{j4}}</td>
                <td>{{s4}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
        <table class="layui-table">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>费用编号</td>
                <td>名称</td>
                <td>规格型号<br/>(姓名)</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率(%)</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr5" :key="index+5">
                <td>
                    <span class="operation" @click="adduser(2, item.id, 4)">编辑</span>
                    <span @click="del(item.id)" class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.cl_num}}</td>
                <td>{{item.associate.cl_name}}</td>
                <td>{{item.associate.cl_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>文化宣传合计</b></td>
                <td>{{j5}}</td>
                <td>{{s5}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
    </div>
    <div class="x-body" id="addopen" style="display: none;">
        <div class="layui-tab" lay-filter="types">
            <ul class="layui-tab-title" id="tabli">
                <li class="layui-this">材料信息</li>
                <li>工人信息</li>
                <li>机械信息</li>
                <li>临建信息</li>
                <li>文化宣传信息</li>
            </ul>
            <div class="layui-tab-content" id="tabcontext" style="height: 100px;">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form" id="tabs1" lay-filter="tabs1">
                        <div class="layui-form-item">
                            <label for="cl_name" v-show="tabs == 0 || tabs == 3" class="layui-form-label">
                                <span class="x-red">*</span>材料名称
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 0 || tabs == 3">
                                <select id="cl_name" lay-filter="demo1" lay-search="" name="cl_name"
                                        class="valid">

                                </select>
                            </div>
                            <label for="cl_num" v-show="tabs == 0 || tabs == 3" class="layui-form-label">
                                <span class="x-red">*</span>材料编号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 0 || tabs == 3">
                                <input type="text" id="cl_num" disabled name="cl_num"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="rg_name" class="layui-form-label" v-show="tabs == 1">
                                <span class="x-red">*</span>姓名
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 1">
                                <select id="rg_name" lay-filter="demo1" lay-search="" name="rg_name"
                                        class="valid">

                                </select>
                            </div>
                            <label for="rg_num" class="layui-form-label" v-show="tabs == 1">
                                <span class="x-red">*</span>人员编号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 1">
                                <input type="text" id="rg_num" disabled name="rg_num"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="jx_name" class="layui-form-label" v-show="tabs == 2">
                                <span class="x-red">*</span>机械名称
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 2">
                                <select id="jx_name" lay-filter="demo1" lay-search="" name="jx_name" class="valid">

                                </select>
                            </div>
                            <label for="jx_num" class="layui-form-label" v-show="tabs == 2">
                                <span class="x-red">*</span>机械编号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 2">
                                <input type="text" id="jx_num" disabled name="jx_num"
                                       autocomplete="off" class="layui-input">
                            </div>

                            <label for="wh_name" class="layui-form-label" v-show="tabs == 4">
                                <span class="x-red">*</span>名称
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 4">
                                <select id="wh_name" lay-filter="demo1" lay-search="" name="wh_name" class="valid">

                                </select>
                            </div>
                            <label for="wh_num" class="layui-form-label" v-show="tabs == 4">
                                <span class="x-red">*</span>费用编号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 4">
                                <input type="text" id="wh_num" disabled name="wh_num"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="cl_model" v-show="tabs == 0 || tabs == 3" class="layui-form-label">
                                <span class="x-red">*</span>材料型号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 0 || tabs == 3">
                                <select id="cl_model" lay-filter="demo2" lay-search="" name="cl_model"
                                        class="valid">

                                </select>
                            </div>
                            <label for="rg_model" class="layui-form-label" v-show="tabs == 1">
                                <span class="x-red">*</span>工种
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 1">
                                <select id="rg_model" lay-filter="demo2" lay-search="" name="rg_model"
                                        class="valid">

                                </select>
                            </div>
                            <label for="jx_model" class="layui-form-label" v-show="tabs == 2">
                                <span class="x-red">*</span>机械型号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 2">
                                <select id="jx_model" lay-filter="demo2" lay-search="" name="jx_model"
                                        class="valid">

                                </select>
                            </div>
                            <label for="wh_model" class="layui-form-label" v-show="tabs == 4">
                                <span class="x-red">*</span>规格型号
                            </label>
                            <div class="layui-input-inline" v-show="tabs == 4">
                                <select id="wh_model" lay-filter="demo2" lay-search="" name="wh_model"
                                        class="valid">

                                </select>
                            </div>

                            <label for="unit" class="layui-form-label">
                                <span class="x-red">*</span>单位
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="unit" lay-verify="required" v-model="unit" name="unit"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="number" class="layui-form-label">
                                <span class="x-red">*</span>数量
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" v-model="number" oninput="upreal()"
                                       onkeyup="value=value.replace(/[^\d.]/g,'')" id="number" lay-verify="required"
                                       name="number"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="rate" class="layui-form-label">
                                <span class="x-red">*</span>税率(%)
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" v-model="rate" oninput="upreal()"
                                       onkeyup="value=value.replace(/[^\d.]/g,'')" lay-verify="required" id="rate"
                                       name="rate"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="tpice" class="layui-form-label">
                                <span class="x-red">*</span>含税价
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="tpice" oninput="upreal()"
                                       onkeyup="value=value.replace(/[^\d.]/g,'')" v-model="tpice" lay-verify="required"
                                       name="tpice"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="ntpice" class="layui-form-label">
                                <span class="x-red">*</span>不含税价
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="ntpice" v-model="ntpice" disabled name="ntpice"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="amount" class="layui-form-label">
                                <span class="x-red">*</span>金额
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="amount" v-model="amount" disabled name="amount"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="tax" class="layui-form-label">
                                <span class="x-red">*</span>税额
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="tax" v-model="tax" disabled name="tax"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="pof" class="layui-form-label">
                                <span class="x-red">*</span>使用部位
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="pof" v-model="pof" lay-verify="required" name="pof"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <label for="note" class="layui-form-label">
                                备注
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="note" v-model="note" name="note"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="tcreatetime" class="layui-form-label">
                                <span class="x-red">*</span>日期
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" name="tcreatetime" lay-verify="date" placeholder=""
                                       autocomplete="off" placeholder="选择日期" class="layui-input" id="tcreatetime">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                            </label>
                            <button class="layui-btn" type="button" lay-filter="add" lay-submit="">
                                保存
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div style="display: none" id="hesan">
        <table class="layui-table tab1">
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>材料编号</td>
                <td>材料名称</td>
                <td>规格型号<br/>(姓名)</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr1">
                <td><span class="operation">编辑</span> <span class="operation">删除</span></td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.cl_num}}</td>
                <td>{{item.associate.cl_name}}</td>
                <td>{{item.associate.cl_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr>
                <td colspan="4"></td>
                <td colspan="8">材料费合计</td>
                <td>{{j1}}</td>
                <td>{{s1}}</td>
                <td colspan="2"></td>
            </tr>
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>人员编号</td>
                <td>工种</td>
                <td>规格型号<br/>(姓名)</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr2">
                <td><span class="operation">编辑</span> <span class="operation">删除</span></td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.ry_num}}</td>
                <td>{{item.associate.ry_type}}</td>
                <td>{{item.associate.ry_name}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8">人工费合计</td>
                <td>{{j2}}</td>
                <td>{{s2}}</td>
                <td colspan="2"></td>
            </tr>
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>机械编号</td>
                <td>机械名称</td>
                <td>规格型号<br/></td>
                <td>单位</td>
                <td>数量</td>
                <td>税率</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr3">
                <td><span class="operation">编辑</span> <span class="operation">删除</span></td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.jx_num}}</td>
                <td>{{item.associate.jx_name}}</td>
                <td>{{item.associate.jx_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8">机械费合计</td>
                <td>{{j3}}</td>
                <td>{{s3}}</td>
                <td colspan="2"></td>
            </tr>
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>材料编号</td>
                <td>材料名称</td>
                <td>规格型号</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr4">
                <td>
                    <span class="operation">编辑</span>
                    <span class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.jx_num}}</td>
                <td>{{item.associate.jx_name}}</td>
                <td>{{item.associate.jx_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>临建合计</b></td>
                <td>{{j4}}</td>
                <td>{{s4}}</td>
                <td colspan="2"></td>
            </tr>
            <tr class="gray" style="font-weight: bold">
                <td>操作</td>
                <td>序号</td>
                <td>填写日期</td>
                <td>填表人</td>
                <td>费用编号</td>
                <td>名称</td>
                <td>规格型号<br/>(姓名)</td>
                <td>单位</td>
                <td>数量</td>
                <td>税率</td>
                <td>含税价</td>
                <td>不含税价</td>
                <td>金额</td>
                <td>税额</td>
                <td>使用部位</td>
                <td>备注</td>
            </tr>
            <tr v-for="(item, index) in arr5">
                <td>
                    <span class="operation">编辑</span>
                    <span class="operation">删除</span>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.createtime}}</td>
                <td>{{item.user_name}}</td>
                <td>{{item.associate.jx_num}}</td>
                <td>{{item.associate.jx_name}}</td>
                <td>{{item.associate.jx_model}}</td>
                <td>{{item.unit}}</td>
                <td>{{item.num}}</td>
                <td>{{item.tax_fee}}</td>
                <td>{{item.tax_money}}</td>
                <td>{{item.notax_money}}</td>
                <td>{{item.total_money}}</td>
                <td>{{item.total_taxmoney}}</td>
                <td>{{item.use_part}}</td>
                <td>{{item.note}}</td>
            </tr>
            <tr class="gray">
                <td colspan="4"></td>
                <td colspan="8"><b>文化宣传合计</b></td>
                <td>{{j5}}</td>
                <td>{{s5}}</td>
                <td colspan="2"></td>
            </tr>
        </table>
    </div>
</div>
<div id="demo8"></div>
<script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../js/vue.js"></script>
<script type="text/javascript" src="../layui/layui.all.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/excel.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
</body>
</html>
<script>
    var vm = new Vue({
        el: '#all',
        data: {
            arr1: [],
            arr2: [],
            arr3: [],
            arr4: [],
            arr5: [],
            tabs: 0, //tab index
            page: 1,
            project_id: sessionStorage.getItem('projectopt'),
            j1: '0', //材料 金额
            s1: '0',  //材料 税额
            j2: '0', //人工 金额
            s2: '0',  //人工 税额
            j3: '0', //机械 金额
            s3: '0',  //机械 税额
            j4: '0', //机械 金额
            s4: '0',  //机械 税额
            j5: '0', //机械 金额
            s5: '0',  //机械 税额
            amount: '', //金额
            number: '', //数量
            rate: '', //税率
            tax: '', //税额
            unit: '', //单位
            tpice: '', //含税价
            note: '', //备注
            pof: '', //使用部位
            ntpice: '', //不含税价
            cid: '', //材料selectid
            rid: '', //人员select id
            jid: '',//机械select id
            lid: '',//临建select id
            wid: '',//文化select id
            stus: '', //新增修改标识
            tid: '', //当前编辑id
            permissions: '',//权限标识
            cuobj: ''
        },
        created: function () {
            this.initData();
        },
        mounted: function(){
            layui.use(['laypage', 'layer', 'element', 'form'], function () {
                var laypage = layui.laypage,
                    layer = layui.layer,
                    form = layui.form,
                    element = layui.element,
                    laydate = layui.laydate,
                    $ = layui.jquery;

                laydate.render({
                    elem: '#tcreatetime',
                    value: new Date()
                })
                element.on('tab(types)', function (data) {
                    if (vm.tabs != data.index) {
                        vm.number = '';
                        vm.unit = '';
                        vm.rate = '';
                        vm.tpice = '';
                        vm.pof = '';
                        vm.note = '';
                        vm.amount = '';
                        vm.tax = '';
                        vm.ntpice = '';
                    }
                    vm.tabs = data.index;
                });
                form.on('select(demo1)', function (data) {
                    var da = data.value;
                    var load = layer.load(2, {
                        shade: [0.6, '#fff'] //0.1透明度的白色背景
                    })
                    if (vm.tabs == 0 || vm.tabs == 3) {
                        var opvalue = '';
                        opvalue += '<option value="">请选择</option>';
                        var obj = {
                            project_id: vm.project_id,
                            type: 1,
                            name: da
                        }
                        $("#cl_num").val('');
                        $("#cl_model").empty();
                        $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleitwo', obj).done(function (res) {
                                if (res.code == 1) {
                                    var arr = res.data;
                                    for (item in arr) {
                                        opvalue += '<option   value="' + arr[item].id + ',' + arr[item].number + '">' + arr[item].model + '</option>'
                                    }
                                    $("#cl_model").append(opvalue);
                                    layui.form.render('select');// 再次渲染select
                                    if (vm.cuobj.id) {
                                        var selects = 'dd[lay-value="' + vm.cuobj.id + ',' + vm.cuobj.cl_num + '"]';// 设置value
                                        $('#cl_model').siblings("div.layui-form-select").find('dl').find(selects).click();
                                        vm.cuobj = '';
                                    }

                                }
                                layui.layer.close(load)
                            })
                        )

                    } else if (vm.tabs == 1) {
                        var opvalue = '';
                        opvalue += '<option value="">请选择</option>';
                        var obj = {
                            project_id: vm.project_id,
                            type: 2,
                            name: da
                        }
                        $("#rg_num").val('');
                        $("#rg_model").empty();
                        $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleitwo', obj).done(function (res) {
                                if (res.code == 1) {
                                    var arr = res.data;
                                    for (item in arr) {
                                        opvalue += '<option   value="' + arr[item].id + ',' + arr[item].number + '">' + arr[item].model + '</option>'
                                    }
                                    $("#rg_model").append(opvalue);
                                    layui.form.render('select');// 再次渲染select
                                    if (vm.cuobj.id) {
                                        var selects = 'dd[lay-value="' + vm.cuobj.id + ',' + vm.cuobj.ry_num + '"]';// 设置value
                                        $('#rg_model').siblings("div.layui-form-select").find('dl').find(selects).click();
                                        vm.cuobj = '';
                                    }
                                }
                                layui.layer.close(load)
                            })
                        )
//                vm.rid = darr[2];
                    } else if (vm.tabs == 2) {
                        var opvalue = '';
                        opvalue += '<option value="">请选择</option>';
                        var obj = {
                            project_id: vm.project_id,
                            type: 3,
                            name: da
                        }
                        $("#jx_num").val('');
                        $("#jx_model").empty();
                        $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleitwo', obj).done(function (res) {
                                if (res.code == 1) {
                                    var arr = res.data;
                                    for (item in arr) {
                                        opvalue += '<option   value="' + arr[item].id + ',' + arr[item].number + '">' + arr[item].model + '</option>'
                                    }
                                    $("#jx_model").append(opvalue);
                                    layui.form.render('select');// 再次渲染select
                                    if (vm.cuobj.id) {
                                        var selects = 'dd[lay-value="' + vm.cuobj.id + ',' + vm.cuobj.jx_num + '"]';// 设置value
                                        $('#jx_model').siblings("div.layui-form-select").find('dl').find(selects).click();
                                        vm.cuobj = '';
                                    }
                                }
                                layui.layer.close(load)
                            })
                        )
                    } else if (vm.tabs == 4) {
                        var opvalue = '';
                        opvalue += '<option value="">请选择</option>';
                        var obj = {
                            project_id: vm.project_id,
                            type: 1,
                            name: da
                        }
                        $("#wh_num").val('');
                        $("#wh_model").empty();
                        $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleitwo', obj).done(function (res) {
                                if (res.code == 1) {
                                    var arr = res.data;
                                    for (item in arr) {
                                        opvalue += '<option   value="' + arr[item].id + ',' + arr[item].number + '">' + arr[item].model + '</option>'
                                    }
                                    $("#wh_model").append(opvalue);
                                    layui.form.render('select');// 再次渲染select
                                    if (vm.cuobj.id) {
                                        var selects = 'dd[lay-value="' + vm.cuobj.id + ',' + vm.cuobj.cl_num + '"]';// 设置value
                                        $('#wh_model').siblings("div.layui-form-select").find('dl').find(selects).click();
                                        vm.cuobj = '';
                                    }

                                }
                                layui.layer.close(load)
                            })
                        )
                    }

                });
                form.on('select(demo2)', function (data) {
                    var darr = data.value.split(',');
                    if (vm.tabs == 0 || vm.tabs == 3) {
                        $("#cl_num").val(darr[1]);
                        vm.cid = darr[0];
                        vm.lid = darr[0];
                    } else if (vm.tabs == 1) {
                        $("#rg_num").val(darr[1]);
                        vm.rid = darr[0];
                    } else if (vm.tabs == 2) {
                        $("#jx_num").val(darr[1]);
                        vm.jid = darr[0];
                    } else if (vm.tabs == 4) {
                        $("#wh_num").val(darr[1]);
                        vm.wid = darr[0];
                    }
                })
                form.on('submit(add)', function (data) {
                    var load = layer.load(2, {
                        shade: [0.6, '#fff'] //0.1透明度的白色背景
                    });
                    var obj = {
                        project_id: vm.project_id,
                        type: vm.tabs + 1,
                        num: data.field.number,
                        unit: data.field.unit,
                        tax_fee: data.field.rate / 100,
                        tax_money: data.field.tpice,
                        use_part: data.field.pof,
                        note: data.field.note,
                        createtime: data.field.tcreatetime
                    }
                    if (vm.tabs == 0) {
                        obj.associate_id = vm.cid;
                    } else if (vm.tabs == 1) {
                        obj.associate_id = vm.rid;
                    } else if (vm.tabs == 2) {
                        obj.associate_id = vm.jid;
                    } else if (vm.tabs == 3) {
                        obj.associate_id = vm.lid;
                    } else if (vm.tabs == 4) {
                        obj.associate_id = vm.wid;
                    }
                    var url = '';
                    if (vm.stus == 1) {
                        url = 'api/Anqumoney/anqumoneyadd';
                    } else {
                        url = 'api/Anqumoney/anqumoneyeditdo';
                        obj.id = vm.tid;
                    }
                    $.when(PUATTRBUTE.REQUESTFUN(url, obj).done(function (res) {
                            layui.layer.close(load)
                            if (res.code == 1) {
                                layer.closeAll();
                                layui.layer.msg(res.msg, {time: 1000, icon: 1});
                                layui.form.render();
                                vm.initData();
                            } else {
                                layui.layer.msg(res.msg, {time: 1000, icon: 2})
                            }
                        })
                    )
                })
                window.upreal = function () {
                    if ($("#number").val() != '') {
                        vm.number = $("#number").val();
                    }
                    if ($("#rate").val() != '') {
                        vm.rate = $("#rate").val();
                    }
                    if ($("#tpice").val() != '') {
                        vm.tpice = $("#tpice").val();
                    }
                    if (vm.number != '' && vm.rate != '' && vm.tpice != '') {
                        var p1 = vm.tpice / (1 + vm.rate / 100) + "";
                        vm.ntpice = PUATTRBUTE.CHANGETWO(p1);
                        var p2 = ((vm.tpice / (1 + vm.rate / 100)) * vm.number) + "";
                        vm.amount = PUATTRBUTE.CHANGETWO(p2);
                        var p3 = ((vm.tpice / (1 + vm.rate / 100)) * (vm.rate / 100) * vm.number) + "";
                        vm.tax = PUATTRBUTE.CHANGETWO(p3);
                    }
                }
            });
            this.initselect();
        },
        methods: {
            //初始化数据
            initData: function () {
                var obj = {
                    page: this.page,
                    limit: 99,
                    project_id: this.project_id
                }
                var load = layer.load(2, {
                    shade: [0.6, '#fff'] //0.1透明度的白色背景
                })
                $.when(PUATTRBUTE.REQUESTFUN('api/Anqumoney/anqumoneyindex', obj).done(function (res) {
                        layer.close(load)
                        if (res.code == 1) {
                            //材料
                            var total_money = 0;
                            var total_taxmoney = 0;
                            for (item in res.data.cailiao) {
                                total_money += PUATTRBUTE.CHANGETWO(res.data.cailiao[item].total_money);
                                total_taxmoney += PUATTRBUTE.CHANGETWO(res.data.cailiao[item].total_taxmoney);
                                res.data.cailiao[item].tax_fee = res.data.cailiao[item].tax_fee * 100;
                            }
                            vm.arr1 = res.data.cailiao;
                            vm.j1 = total_money.toFixed(2);
                            vm.s1 = total_taxmoney.toFixed(2);
                            //人工
                            var total_money = 0;
                            var total_taxmoney = 0;
                            for (item in res.data.rengong) {
                                total_money += PUATTRBUTE.CHANGETWO(res.data.rengong[item].total_money);
                                total_taxmoney += PUATTRBUTE.CHANGETWO(res.data.rengong[item].total_taxmoney);
                                res.data.rengong[item].tax_fee = res.data.rengong[item].tax_fee * 100;
                            }
                            vm.arr2 = res.data.rengong;
                            vm.j2 = total_money.toFixed(2);
                            vm.s2 = total_taxmoney.toFixed(2);
                            //机械
                            var total_money = 0;
                            var total_taxmoney = 0;
                            for (item in res.data.jixie) {
                                total_money += PUATTRBUTE.CHANGETWO(res.data.jixie[item].total_money);
                                total_taxmoney += PUATTRBUTE.CHANGETWO(res.data.jixie[item].total_taxmoney);
                                res.data.jixie[item].tax_fee = res.data.jixie[item].tax_fee * 100;
                            }
                            vm.arr3 = res.data.jixie;
                            vm.j3 = total_money;
                            vm.s3 = total_taxmoney;
                            //临界
                            var total_money = 0;
                            var total_taxmoney = 0;
                            for (item in res.data.linjian) {
                                total_money += PUATTRBUTE.CHANGETWO(res.data.linjian[item].total_money);
                                total_taxmoney += PUATTRBUTE.CHANGETWO(res.data.linjian[item].total_taxmoney);
                                res.data.linjian[item].tax_fee = res.data.linjian[item].tax_fee * 100;
                            }
                            vm.arr4 = res.data.linjian;
                            vm.j4 = total_money;
                            vm.s4 = total_taxmoney;
                            //文化
                            var total_money = 0;
                            var total_taxmoney = 0;
                            for (item in res.data.wenhua) {
                                total_money += PUATTRBUTE.CHANGETWO(res.data.wenhua[item].total_money);
                                total_taxmoney += PUATTRBUTE.CHANGETWO(res.data.wenhua[item].total_taxmoney);
                                res.data.wenhua[item].tax_fee = res.data.wenhua[item].tax_fee * 100;
                            }
                            vm.arr5 = res.data.wenhua;
                            vm.j5 = total_money;
                            vm.s5 = PUATTRBUTE.CHANGETWO(total_taxmoney);
                        } else {
                            if (res.msg == "暂无权限") {
                                vm.permissions = 1;
                            }
                            layer.msg(res.msg, {time: 1000, icon: 2})
                        }
                    })
                )
            },
            //打开面板
            adduser: function (idx, tid, tabs) {
                if (this.permissions == 1) {
                    layer.alert("抱歉，您没有此权限！");
                } else {
                    var title = ''
                    this.stus = idx;
                    this.tid = tid;
                    vm.tabs = 0;
                    vm.num = '';
                    vm.unit = '';
                    vm.note = '';
                    vm.money = '';
                    vm.total = '';
                    vm.ntpice = ''; //编号
                    vm.pof = ''; //编号
                    vm.amount = ''; //编号
                    vm.number = ''; //编号
                    vm.rate = ''; //编号
                    vm.tax = ''; //编号
                    vm.tpice = ''; //编号
                    $("#tcreatetime").val(PUATTRBUTE.NEWDATE());
                    var select = 'dd[lay-value=""]';// 设置value
                    $('#cl_name').siblings("div.layui-form-select").find('dl').find(select).click();
                    $('#cl_model').siblings("div.layui-form-select").find('dl').find(select).click();
                    $('#rg_name').siblings("div.layui-form-select").find('dl').find(select).click();
                    $("#rg_num").val('');
                    $('#rg_model').siblings("div.layui-form-select").find('dl').find(select).click();
                    $('#jx_name').siblings("div.layui-form-select").find('dl').find(select).click();
                    $("#jx_num").val('');
                    $('#jx_model').siblings("div.layui-form-select").find('dl').find(select).click();
                    $('#wh_name').siblings("div.layui-form-select").find('dl').find(select).click();
                    $("#wh_num").val('');
                    $('#wh_model').siblings("div.layui-form-select").find('dl').find(select).click();
                    layui.form.render('select');// 再次渲染select
                    if (idx == 1) {
                        title = '新增信息';
                        $("#tabli li:eq(0)").show();
                        $("#tabli li:eq(1)").show();
                        $("#tabli li:eq(2)").show();
                        $("#tabli li:eq(3)").show();
                        $("#tabli li:eq(4)").show();
                        layui.form.render();
                        $("#tabli li:eq(0)").addClass('layui-this').siblings('li').removeClass('layui-this');
                    } else {
                        //编辑初始化数据
                        var obj = {
                            id: tid,
                            project_id: vm.project_id
                        }
                        //切换面板隐藏顶部li
                        if (tabs == 0) {
                            $("#tabli li:eq(0)").addClass('layui-this').siblings('li').removeClass('layui-this');
                            $("#tabli li:eq(0)").show();
                            $("#tabli li:eq(1)").hide();
                            $("#tabli li:eq(2)").hide();
                            $("#tabli li:eq(3)").hide();
                            $("#tabli li:eq(4)").hide();
                            vm.tabs = 0;
                        } else if (tabs == 1) {
                            $("#tabli li:eq(1)").addClass('layui-this').siblings('li').removeClass('layui-this');
                            $("#tabli li:eq(0)").hide();
                            $("#tabli li:eq(1)").show();
                            $("#tabli li:eq(2)").hide();
                            $("#tabli li:eq(3)").hide();
                            $("#tabli li:eq(4)").hide();
                            vm.tabs = 1;
                        } else if (tabs == 2) {
                            $("#tabli li:eq(2)").addClass('layui-this').siblings('li').removeClass('layui-this');
                            $("#tabli li:eq(0)").hide();
                            $("#tabli li:eq(1)").hide();
                            $("#tabli li:eq(2)").show();
                            $("#tabli li:eq(3)").hide();
                            $("#tabli li:eq(4)").hide();
                            vm.tabs = 2;
                        } else if (tabs == 3) {
                            $("#tabli li:eq(3)").addClass('layui-this').siblings('li').removeClass('layui-this');
                            $("#tabli li:eq(3)").show();
                            $("#tabli li:eq(1)").hide();
                            $("#tabli li:eq(2)").hide();
                            $("#tabli li:eq(0)").hide();
                            $("#tabli li:eq(4)").hide();
                            vm.tabs = 3;
                        } else if (tabs == 4) {
                            $("#tabli li:eq(4)").addClass('layui-this').siblings('li').removeClass('layui-this');
                            $("#tabli li:eq(0)").hide();
                            $("#tabli li:eq(1)").hide();
                            $("#tabli li:eq(2)").hide();
                            $("#tabli li:eq(3)").hide();
                            $("#tabli li:eq(4)").show();
                            vm.tabs = 4;
                        }
                        title = '编辑信息';
                        $.when(PUATTRBUTE.REQUESTFUN('api/Anqumoney/anqumoneyedit', obj).done(function (res) {
                                if (res.code == 1) {
                                    if (res.data.type == 1 || res.data.type == 4) {
                                        var select = 'dd[lay-value="' + res.data.associate_id.cl_name + '"]';// 设置value
                                        $('#cl_name').siblings("div.layui-form-select").find('dl').find(select).click();
                                        vm.cuobj = res.data.associate_id;
                                        vm.cid = res.data.associate_id.id;
                                    } else if (res.data.type == 2) {
                                        var select = 'dd[lay-value="' + res.data.associate_id.ry_name + '"]';// 设置value
                                        $('#rg_name').siblings("div.layui-form-select").find('dl').find(select).click();
                                        vm.cuobj = res.data.associate_id;
                                        vm.rid = res.data.associate_id.id;
                                    } else if (res.data.type == 3) {
                                        var select = 'dd[lay-value="' + res.data.associate_id.jx_name + '"]';// 设置value
                                        $('#jx_name').siblings("div.layui-form-select").find('dl').find(select).click();
                                        vm.cuobj = res.data.associate_id;
                                        vm.jid = res.data.associate_id.id;
                                    } else if (res.data.type == 5) {
                                        var select = 'dd[lay-value="' + res.data.associate_id.cl_name + '"]';// 设置value
                                        $('#wh_name').siblings("div.layui-form-select").find('dl').find(select).click();
                                        vm.cuobj = res.data.associate_id;
                                        vm.cid = res.data.associate_id.id;
                                    }
                                    layui.form.render('select');// 再次渲染select
                                    vm.unit = res.data.unit; //单位
                                    vm.number = res.data.num; //数量
                                    vm.tpice = res.data.tax_money; //含税价
                                    vm.ntpice = res.data.notax_money; //不含税
                                    vm.rate = res.data.tax_fee * 100; //税率
                                    vm.amount = res.data.notax_money; //金额
                                    vm.tax = res.data.total_taxmoney; //税额
                                    vm.pof = res.data.use_part;
                                    vm.note = res.data.note;//备注
                                    $('#tcreatetime').val(vm.formatDate(res.data.createtime));
                                } else {
                                    layer.msg(res.msg, {time: 1000, icon: 2})
                                }
                            })
                        )
                    }
                    layui.form.render('select');// 再次渲染select
                    layer.open({
                        type: 1,
                        skin: 'layui-layer-rim', //加上边框
                        area: ['700px', '550px'], //宽高
                        title: title,
                        content: $("#addopen")
                    });
                }
            },
            formatDate: function (crtime) {
                var date = new Date(parseInt(crtime) * 1000) // 时间戳为10位需乘1000，为13位则不用
                var Y = date.getFullYear() // 年
                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) // 月
                var D = date.getDate() < 10 ? '0' + date.getDate() + '' : date.getDate() + '' // 日
                return Y + '-' + M + '-' + D // yyyy-mm-dd
            },
            //初始化select
            initselect: function () {
                var obj = {
                    project_id: this.project_id,
                    page: 1,
                    limit: 99
                }
                var materialhtml = ''; //材料
                var artificial = ''; //人工
                var mechanical = ''; //机械
                materialhtml += '<option value="">请选择</option>';
                artificial += '<option value="">请选择</option>';
                mechanical += '<option value="">请选择</option>';
                var obj = {
                    project_id: this.project_id,
                    type: 1
                }
                $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleione', obj).done(function (res) {
                        if (res.code == 1) {
                            var arr = res.data;
                            for (item in arr) {
                                materialhtml += '<option   value="' + arr[item].name + '">' + arr[item].name + '</option>'
                            }
                            $("#cl_name").append(materialhtml);
                            $("#wh_name").append(materialhtml);
                        } else {
                            layer.msg(res.msg, {time: 1000, icon: 2})
                        }
                    })
                )
                var obj2 = {
                    project_id: this.project_id,
                    type: 2
                }
                $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleione', obj2).done(function (res) {
                        if (res.code == 1) {
                            sessionStorage.setItem('artificial', JSON.stringify(res.data.list));
                            var arr = res.data;
                            for (item in arr) {
                                artificial += '<option   value="' + arr[item].name + '">' + arr[item].name + '</option>'
                            }
                            $("#rg_name").append(artificial);
                        } else {
                            layer.msg(res.msg, {time: 1000, icon: 2})
                        }
                    })
                )
                var obj3 = {
                    project_id: this.project_id,
                    type: 3
                }
                $.when(PUATTRBUTE.REQUESTFUN('api/Classify/fenleione', obj3).done(function (res) {
                        if (res.code == 1) {
                            sessionStorage.setItem('mechanical', JSON.stringify(res.data.list));
                            var arr = res.data;
                            for (item in arr) {
                                mechanical += '<option   value="' + arr[item].name + '">' + arr[item].name + '</option>'
                            }
                            $("#jx_name").append(mechanical);
                        } else {
                            layer.msg(res.msg, {time: 1000, icon: 2})
                        }
                    })
                )
                layui.form.render();
            },
            //导出
            exports: function () {
                if (this.permissions == 1) {
                    layer.alert("抱歉，您没有此权限！");
                } else {
                    var tableHtml = $('#hesan');
                    $(tableHtml).css({
                        'border': '1px solid #d5d5d2',
                        'text-align': 'center',
                        'border-collapse': 'collapse',
                    });
                    $(tableHtml).find('tr td').css({
                        'text-align': 'center',
                        'border': '1px solid #d5d5d2',
                        'line-height': '30px',
                        'padding': '0px 10px',
                        'min-width': '100px'
                    });
                    var html = "<html><head><meta charset='utf-8' /></head><body>" + tableHtml[0].outerHTML + "</body></html>";
// 实例化一个Blob对象，其构造函数的第一个参数是包含文件内容的数组，第二个参数是包含文件类型属性的对象
                    var blob = new Blob([html], {type: "application/vnd.ms-excel"});
                    var urlA = document.createElement('a');
// 利用URL.createObjectURL()方法为a元素生成blob URL
                    $('.table-btn-group').append(urlA);
                    urlA.href = URL.createObjectURL(blob);
// 设置文件名，目前只有Chrome和FireFox支持此属性
                    urlA.download = "安全文明措施费.xls";
                    urlA.click();
                }
            },
            //删除
            del: function (e) {
                var obj = {
                    id: e,
                    project_id: vm.project_id
                }
                layer.confirm('确定删除吗？', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    var load = layer.load(2, {
                        shade: [0.6, '#fff'] //0.1透明度的白色背景
                    })
                    $.when(PUATTRBUTE.REQUESTFUN('api/Anqumoney/anqumoneydel', obj).done(function (res) {
                            layer.close(load);
                            if (res.code == 1) {
                                layer.msg(res.msg, {time: 1000, icon: 1})
                                vm.initData();
                            } else {
                                layer.msg(res.msg, {time: 1000, icon: 2})
                            }
                        })
                    )
                }, function () {
                    layer.closeAll();
                });
            }
        }
    })
</script>

